<?php

namespace Ycr\Pack;


use Ycr\Pack\exception\HttpErrorException;

use Ycr\Pack\helpers\EncryptionHelper;

require_once 'src/helpers/EncryptionHelper.php';

require_once 'src/exception/HttpErrorException.php';

require_once 'src/redis/BaseRedisConnect.php';

require_once 'src/redis/RedisPageCache.php';

echo '<pre/>' ;

echo '请求到类了' . PHP_EOL ;

try {

    $asr[1] = array("id"=>1, "title"=>'测试轮播图 b1', "create_time"=>'c1');
    $asr[2] = array("id"=>2, 'title'=>"测试轮播图 b2", 'create_time'=>"c2");
    $asr[3] = array('id'=>3, 'title'=>"测试轮播图 b3", 'create_time'=>"c3");


    $redis = new \Ycr\Pack\redis\RedisPageCache(); //实例化对象

    $new_array = array();

    foreach ($asr as $a) {
        $redis->set_redis_page_info($a['id'],$a);
        $new_array[] = $a;
    }

    $res  =$redis->get_redis_page_list(1,5);

    print_r($res);

} catch (HttpErrorException $exception) {

    var_export($exception->getMessage());

}


echo '<br/>';

echo '我成功了' . PHP_EOL ;